package app.myproject.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable(detachable="true")
public class BookmarkVO implements java.io.Serializable {
	
	private static final long serialVersionUID = 1L;

	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
    private String name;
	
	@Persistent
    private String url;
		
	@Persistent
    private Date created;

	@Persistent
    private String owner;

	public BookmarkVO() {
		super();
	}
	
	public Key getKey() {
		return key;
	}

	public String getKeyAsString() {
		return key != null ? KeyFactory.keyToString(key) : null;
	}
	
	public void setKey(Key key) {
		this.key = key;
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}
	
	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

//	public String toString() {
//		return key != null ? KeyFactory.keyToString(key) : null;
//	}
	
}